
package briefkeys;

public class LogIn extends javax.swing.JFrame {

    public LogIn() {
        initComponents();
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        usernameText = new javax.swing.JTextField();
        passwordText = new javax.swing.JPasswordField();
        loginSmall = new javax.swing.JLabel();
        lableUsername = new javax.swing.JLabel();
        lableUsername1 = new javax.swing.JLabel();
        cancelLogIn = new javax.swing.JButton();
        submitLogIn = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("BriefKeys | Log In");
        setAlwaysOnTop(true);
        setUndecorated(true);
        setResizable(false);

        usernameText.setFont(new java.awt.Font("Courier New", 0, 24)); // NOI18N
        usernameText.setHorizontalAlignment(javax.swing.JTextField.CENTER);

        passwordText.setFont(new java.awt.Font("Courier New", 0, 24)); // NOI18N
        passwordText.setHorizontalAlignment(javax.swing.JTextField.CENTER);

        loginSmall.setIcon(new javax.swing.ImageIcon(getClass().getResource("/briefkeys/log-in-small.png"))); // NOI18N

        lableUsername.setFont(new java.awt.Font("Courier New", 0, 24)); // NOI18N
        lableUsername.setText("USERNAME");

        lableUsername1.setFont(new java.awt.Font("Courier New", 0, 24)); // NOI18N
        lableUsername1.setText("PASSWORD");

        cancelLogIn.setBackground(new java.awt.Color(255, 0, 0));
        cancelLogIn.setFont(new java.awt.Font("Courier New", 0, 24)); // NOI18N
        cancelLogIn.setText("CANCEL");
        cancelLogIn.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cancelLogInActionPerformed(evt);
            }
        });

        submitLogIn.setBackground(new java.awt.Color(0, 153, 0));
        submitLogIn.setFont(new java.awt.Font("Courier New", 0, 24)); // NOI18N
        submitLogIn.setText("LOG IN");
        submitLogIn.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                submitLogInMouseClicked(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addComponent(loginSmall)
                .addGap(6, 6, 6)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(lableUsername)
                    .addComponent(lableUsername1))
                .addGap(10, 10, 10)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(usernameText, javax.swing.GroupLayout.PREFERRED_SIZE, 275, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(passwordText, javax.swing.GroupLayout.PREFERRED_SIZE, 275, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(submitLogIn, javax.swing.GroupLayout.PREFERRED_SIZE, 175, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(cancelLogIn, javax.swing.GroupLayout.PREFERRED_SIZE, 175, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(11, 11, 11)
                        .addComponent(loginSmall))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(22, 22, 22)
                        .addComponent(lableUsername)
                        .addGap(40, 40, 40)
                        .addComponent(lableUsername1))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(11, 11, 11)
                        .addComponent(usernameText, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(passwordText, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(cancelLogIn, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(submitLogIn, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
        setLocationRelativeTo(null);
    }// </editor-fold>//GEN-END:initComponents

    private void cancelLogInActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelLogInActionPerformed
        BriefKeys.main.setEnabled(true);
        this.dispose();
    }//GEN-LAST:event_cancelLogInActionPerformed

    private void submitLogInMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_submitLogInMouseClicked
        if (usernameText.getText().equals("jowncarlo") && passwordText.getText().equals("nightstars")) {
            BriefKeys.main.dispose();
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new UserOkay().setVisible(true);
                }
            });
            this.dispose();
        } else {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new InvalidThing().setVisible(true);
                }
            });
            this.dispose();
        }
    }//GEN-LAST:event_submitLogInMouseClicked

    public static void main(String args[]) {
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(LogIn.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(LogIn.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(LogIn.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(LogIn.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new LogIn().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton cancelLogIn;
    private javax.swing.JLabel lableUsername;
    private javax.swing.JLabel lableUsername1;
    private javax.swing.JLabel loginSmall;
    private javax.swing.JPasswordField passwordText;
    private javax.swing.JButton submitLogIn;
    private javax.swing.JTextField usernameText;
    // End of variables declaration//GEN-END:variables
}
